package com.mr.qa.dao.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;

public class CityDAO extends BaseHibernateDAO {
	private static final Log log = LogFactory.getLog(AnswerDAO.class);
	public List findAll() {
        try
        {
            Query queryObject = getSession().
            createQuery("from City as model order by model.id asc");
//            if(this.getPageNo().intValue() > 0 && this.getRecordCount().intValue() > 0)
//            {
//            	queryObject.setFirstResult((getPageNo().intValue() - 1)* getRecordCount().intValue());
//            	queryObject.setMaxResults(getRecordCount().intValue());
//            }
            List results = queryObject.list();
            log.debug("find by example successful, result size: " + results.size());
            return results;
        } catch (RuntimeException re) {
            log.error("find by example failed", re);
            throw re;
        }
    }  
}
